#include "LoanDat.h"
#include "LoanItem.h"
//#include "LOAN.h"







LoanDat::LoanDat(int StID)
{
	//get data from DB, store it in the pointer
}

bool LoanDat::checkSID(int StID)
{
   //Checking whether it enters correct Stand ID by comparing it to the DB
   //if StID == anyStID in DB, return true, else false
   return true;
}
void LoanDat::checkUID(int UID)
{
   //Checking the UID, and show the data of the visitor from the DB
   //if UID == anyUID in DB, return true, else false
}

AnsiString LoanDat::getVisName()      {return this->VisName;}
double LoanDat::getBalance()          {return this->balance;}

int LoanDat::searchItem(AnsiString nm)
{
		  //get the Item with the name nm return the index
		  //else -1
		  return 0;
}

void LoanDat::addToCart(int index, int amount)
{
		  //add the chosen item from the list to the array
		  //add price to totalprice
}

AnsiString LoanDat::getLName(int i)          {return *(this->loanIName[i]);}
int LoanDat::getLAmt(int i)                  {return *(this->loanAmt[i]);}
double LoanDat::ItemPriceLoaned(int index, int amount)
{
		  //calculate the price * amount of the item loaned / item
		  //get the price from the LoanItem object
		  //add it to the total price
		  return 0;
}
double LoanDat::getTotPrice()
{
		 //return the total price
		 return 0;
}

void LoanDat::removeFromCart(int i, int a)
{
		 //decrease the amount of item index=i in cart box equal to a
		 //if the amount is 0, remove it from the cart
		 //decrease the total price
}

AnsiString LoanDat::getRetLoName()
{
		  //get the name of certain loaned item from DB
		  //store them
		  return "On progress";
}

int LoanDat::getRetLoAmt(int)
{
		  //get amount of a certain loaned item DB
		  //store them
		  return 0;
}

int LoanDat::getRetAmt(int)
{
		  //get amount of a certain returned item DB
		  //store them
		  return 0;
}


void LoanDat::loanDone()
{
		 //change the data in DB
}
void LoanDat::returnItem(int i, int a)
{
		 //modify the DB, the item at selected index and amount
}
void LoanDat::returnAll()
{
		 //modify the DB, returning all things loaned
}
void LoanDat::brokenItem(int i, int a)
{
		 //modify the DB, the item at selected index and amount
		 //considered returned, but amt available won't increase
}

